%%%-------------------------------------------------------------------
%%% @author Rain
%%% @doc 随机相关逻辑
%%% @end
%%%-------------------------------------------------------------------
-module(game_util_rand).
-author("Rain").

%% API
-export([rand/0, rand/2]).


%% @doc 随机一个0-1之间的数字
rand() ->
    rand:uniform().

%% @doc 随机一个数字范围
rand(Max, Min) when Max > Min->
    rand(Min, Max);
rand(Min, Max) ->
    rand:uniform(Max - Min + 1) + Min - 1.



